package com.example.module_motorcircle.report.repository

import com.example.lib_net.api.Api
import com.example.module_motorcircle.report.model.TopOffRequestModel
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.flowOn
import javax.inject.Inject

/**
 * @author yaotianxue
 * @description
 * @date 2025/2/14
 */
class ReportRepository @Inject constructor() {
    @Inject
    lateinit var api:Api

    /**
     * 举报类型列表
     */
     fun reportTypeList() = flow {
         emit(api.reportTypeList())
    }.flowOn(Dispatchers.IO)

    /**
     * 举报帖子
     */
    fun reportPost(id:String,tipOffType:String) = flow {
        val model = TopOffRequestModel(id,1,tipOffType)
        emit(api.reportPost(model.toRequestBody()))
    }.flowOn(Dispatchers.IO)

}